﻿using PmSoft.Core.Domain.Entities;
using PmSoft.Core.Domain.Entities.Caching;
using PmSoft.Data.Abstractions.Attributes;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace Demo.Domains.Entities.Sys;

/// <summary>
/// 用户信息
/// </summary>
[Table("sys_user")]
[CacheSetting(true, PropertyNamesOfArea = "DeptId")]
[Description("用户信息")]
[Auditable("sys")]
public class SysUser : Entity<int>
{

	[PrimaryKey("id")]
	public override int Id { get; set; }

	/// <summary>
	/// 姓名或昵称 
	///</summary>
	[Column("name")]
	public string Name { get; set; }
	/// <summary>
	/// 用户类型 
	///</summary>
	[Column("type")]
	public UserType Type { get; set; }
	/// <summary>
	/// 电子邮箱 
	///</summary>
	[Column("email")]
	public string Email { get; set; }
	/// <summary>
	/// 手机号码 
	///</summary>
	[Column("mobile")]
	public string Mobile { get; set; } 
	/// <summary>
	/// 单位ID 
	///</summary>
	[Column("dept_id")]
	public int DeptId { get; set; }
	/// <summary>
	/// 密码 
	///</summary>
	[Column("password")]
	public string Password { get; set; }
	/// <summary>
	/// 创建时间 
	///</summary>
	[Column("create_time")]
	public DateTime CreateTime { get; set; } = DateTime.Now;
}
